package br.com.dp.dao.entidade;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the dia database table.
 * 
 */
@Embeddable
public class DiaPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Temporal(TemporalType.DATE)
	@Column(unique=true, nullable=false)
	private java.util.Date dia;

	@Column(insertable=false, updatable=false, unique=true, nullable=false)
	private int idQuarto;

	public DiaPK() {
	}
	public java.util.Date getDia() {
		return this.dia;
	}
	public void setDia(java.util.Date dia) {
		this.dia = dia;
	}
	public int getIdQuarto() {
		return this.idQuarto;
	}
	public void setIdQuarto(int idQuarto) {
		this.idQuarto = idQuarto;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof DiaPK)) {
			return false;
		}
		DiaPK castOther = (DiaPK)other;
		return 
			this.dia.equals(castOther.dia)
			&& (this.idQuarto == castOther.idQuarto);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.dia.hashCode();
		hash = hash * prime + this.idQuarto;
		
		return hash;
	}
}